package com.dragon.modules.yuegou.query.member;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.member.LiftConditionsEntity;
import com.dragon.modules.yuegou.enums.member.LiftConditionsConditionsTime;
import com.dragon.modules.yuegou.enums.member.LiftConditionsConditionsType;
import com.dragon.modules.yuegou.enums.member.LiftConditionsLiftType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 升降条件 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-11-19 10:02:55
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class LiftConditionsQuery extends LiftConditionsEntity implements Query<LiftConditionsEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "liftId")
	private Condition<String> liftIdCondition;

    /** [枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件 */
	@JsonUnwrapped(prefix = "conditionsTime")
	private Condition<LiftConditionsConditionsTime> conditionsTimeCondition;

    /** [枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件 */
	@JsonUnwrapped(prefix = "conditionsType")
	private Condition<LiftConditionsConditionsType> conditionsTypeCondition;

    /** [枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件 */
	@JsonUnwrapped(prefix = "liftType")
	private Condition<LiftConditionsLiftType> liftTypeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "liftPoints")
	private Condition<Integer> liftPointsCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public LiftConditionsQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public LiftConditionsQuery(LiftConditionsEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public LiftConditionsQuery(LiftConditionsQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.liftIdCondition != null) {
			this.liftIdCondition = other.liftIdCondition.copy();
		}
		if(other.conditionsTimeCondition != null) {
			this.conditionsTimeCondition = other.conditionsTimeCondition.copy();
		}
		if(other.conditionsTypeCondition != null) {
			this.conditionsTypeCondition = other.conditionsTypeCondition.copy();
		}
		if(other.liftTypeCondition != null) {
			this.liftTypeCondition = other.liftTypeCondition.copy();
		}
		if(other.liftPointsCondition != null) {
			this.liftPointsCondition = other.liftPointsCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
	}

	@Override
	public QueryWrapper<LiftConditionsEntity> toQueryWrapper() {
		QueryWrapper<LiftConditionsEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (liftIdCondition != null) {
			liftIdCondition.toWrapper(wrapper, COL_LIFT_ID);
		}
		if (conditionsTimeCondition != null) {
			conditionsTimeCondition.toWrapper(wrapper, COL_CONDITIONS_TIME);
		}
		if (conditionsTypeCondition != null) {
			conditionsTypeCondition.toWrapper(wrapper, COL_CONDITIONS_TYPE);
		}
		if (liftTypeCondition != null) {
			liftTypeCondition.toWrapper(wrapper, COL_LIFT_TYPE);
		}
		if (liftPointsCondition != null) {
			liftPointsCondition.toWrapper(wrapper, COL_LIFT_POINTS);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return liftIdCondition 查询条件
	 */
	public Condition<String> liftId() {
		this.liftIdCondition = new Condition<>();
		return this.liftIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return liftIdCondition 查询条件
	 */
	public Condition<String> getLiftIdCondition() {
		return liftIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param liftIdCondition 查询条件
	 */
	public void setLiftIdCondition(Condition<String> liftIdCondition) {
		this.liftIdCondition = liftIdCondition;
	}

	/**
	 * 构造并返回[枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件
	 * 
	 * @return conditionsTimeCondition [枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件
	 */
	public Condition<LiftConditionsConditionsTime> conditionsTime() {
		this.conditionsTimeCondition = new Condition<>();
		return this.conditionsTimeCondition;
	}
	
	/**
	 * 获取[枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件
	 * 
	 * @return conditionsTimeCondition [枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件
	 */
	public Condition<LiftConditionsConditionsTime> getConditionsTimeCondition() {
		return conditionsTimeCondition;
	}

	/**
	 * 设置[枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件
	 * 
	 * @param conditionsTimeCondition [枚举]会员等级条件时间：1-某天-ONEDAY、2-每天-EVERYDAY、3-某月-ONEMONTH、4-每月-EVERYMONTH查询条件
	 */
	public void setConditionsTimeCondition(Condition<LiftConditionsConditionsTime> conditionsTimeCondition) {
		this.conditionsTimeCondition = conditionsTimeCondition;
	}

	/**
	 * 构造并返回[枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件
	 * 
	 * @return conditionsTypeCondition [枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件
	 */
	public Condition<LiftConditionsConditionsType> conditionsType() {
		this.conditionsTypeCondition = new Condition<>();
		return this.conditionsTypeCondition;
	}
	
	/**
	 * 获取[枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件
	 * 
	 * @return conditionsTypeCondition [枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件
	 */
	public Condition<LiftConditionsConditionsType> getConditionsTypeCondition() {
		return conditionsTypeCondition;
	}

	/**
	 * 设置[枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件
	 * 
	 * @param conditionsTypeCondition [枚举]会员等级条件类型：1-累计积分-CUMULATIVE、2-单笔消费-SINGLE查询条件
	 */
	public void setConditionsTypeCondition(Condition<LiftConditionsConditionsType> conditionsTypeCondition) {
		this.conditionsTypeCondition = conditionsTypeCondition;
	}

	/**
	 * 构造并返回[枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件
	 * 
	 * @return liftTypeCondition [枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件
	 */
	public Condition<LiftConditionsLiftType> liftType() {
		this.liftTypeCondition = new Condition<>();
		return this.liftTypeCondition;
	}
	
	/**
	 * 获取[枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件
	 * 
	 * @return liftTypeCondition [枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件
	 */
	public Condition<LiftConditionsLiftType> getLiftTypeCondition() {
		return liftTypeCondition;
	}

	/**
	 * 设置[枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件
	 * 
	 * @param liftTypeCondition [枚举]升降类型：1-升级规则-UPGRADE、2-降级规则-DEMOTION查询条件
	 */
	public void setLiftTypeCondition(Condition<LiftConditionsLiftType> liftTypeCondition) {
		this.liftTypeCondition = liftTypeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return liftPointsCondition 查询条件
	 */
	public Condition<Integer> liftPoints() {
		this.liftPointsCondition = new Condition<>();
		return this.liftPointsCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return liftPointsCondition 查询条件
	 */
	public Condition<Integer> getLiftPointsCondition() {
		return liftPointsCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param liftPointsCondition 查询条件
	 */
	public void setLiftPointsCondition(Condition<Integer> liftPointsCondition) {
		this.liftPointsCondition = liftPointsCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdByCondition 查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

}
